package correct.day3;

import java.util.PriorityQueue;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), k = in.nextInt();
        PriorityQueue<Integer> heap = new PriorityQueue<>((a, b) -> {
            return b - a;
        });

        long sum = 0, x;
        for(int i = 0; i < n; i++)
        {
            x = in.nextLong();
            sum += x;
            if(x % 2 == 0)
            {
                heap.add((int)x);
            }
        }
        while(!heap.isEmpty() && k-- != 0)
        {
            long t = heap.poll() / 2;
            sum -= t;
            if(t % 2 == 0)
            {
                heap.add((int)t);
            }
        }

        System.out.println(sum);
    }
}
